package com.android;

public class Player {
	//storing information about the cards the player recently pressed.
	//turn here is refering to either 0,1 or 2 in value.
	//depending on how many cards are pressed.
	Integer turn = 0;
	Integer CardId1 = 0;
	Integer CardId2 = 0;
	//These arrays are storing the id and the card positions id
	Boolean[] id = new Boolean[25];
	Integer[] cards = new Integer[25];
	
	//if cardID1 is 0, it means its the players first card he picks. Then set cardID1 to that card.
	//if 2nd turn, cardId2 = id
	public void setCardId(Integer id){
		if(CardId1 == 0){
			this.CardId1 = id;
		}else{
			this.CardId2 = id;
		}
	}
	
	//set the id of the card to the card id position
	public void setRealCardId(Integer id, Integer realID){
		this.cards[id] = realID;
	}
	
	//get the realcardId, refering to the realID assigned to a card.
	public Integer getRealCardId(Integer id){
		return this.cards[id];
	}
	
	//declare a card as finished.
	public void setCardFinished(Integer id, Boolean val){
		this.id[id] = val;
	}
	
	//check if the card has been finished
	public boolean getCardFinished(Integer id){
		return this.id[id];
	}
	
	//clear the two cards that has been checked.
	public void clearCardId(){
		this.CardId1 = 0;
		this.CardId2 = 0;
	}
	
	//Get the cardid of 1
	public Integer getCardId1(){
		return this.CardId1;
	}
	
	//get the cardid of 2
	public Integer getCardId2(){
		return this.CardId2;
	}
	
	//inc player turn, can be 0,1 and 2
	public void incTurn(){
		this.turn +=1;
	}
	
	//reset the turn to 0
	public void resetTurn(){
		this.turn = 0;
	}

	//check what turn the player is on, 0,1,2.
	public Integer getTurn(){
		return this.turn;
	}
}